package org.example.hospital_frontend.service;

import org.example.hospital_frontend.domain.MedicalRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import org.example.hospital_frontend.domain.MedicalRecordVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【medical_record(患者病历表)】的数据库操作Service
* @createDate 2025-05-23 20:34:53
*/
public interface MedicalRecordService extends IService<MedicalRecord> {

    /**
     * 分页查询病历列表，支持按诊断结果、患者用户名、医生姓名搜索
     * @param page 分页对象
     * @param keyword 搜索关键字
     * @return 分页结果 (包含患者和医生用户名)
     */
    Page<MedicalRecordVO> getMedicalRecordVOPage(Page<MedicalRecordVO> page, String keyword);

    /**
     * 根据病历ID获取包含医生姓名的病历详情
     * @param id 病历ID
     * @return MedicalRecordVO 对象，如果不存在则返回 null
     */
    MedicalRecordVO getMedicalRecordVOById(Integer id);

    List<MedicalRecord> selectAllMedicalRecords();
    MedicalRecord selectMedicalRecordById(Long id);
    void deleteMedicalRecordById(Long id);
    List<Map<String, Object>> selectDoctorStatistics();
    List<Map<String, Object>> selectDiagnosisStatistics();
}
